package com.shuoyue.ycgk.ui.mine.collection.infos2;

import android.content.Context;
import android.content.Intent;

import com.shuoyue.ycgk.entity.ChapterType;
import com.shuoyue.ycgk.entity.QuestionParent;
import com.shuoyue.ycgk.ui.mine.collection.CollectionContract;
import com.shuoyue.ycgk.ui.questionbank.base.BaseQuestionActivity;

import java.util.List;

public class QuestionCollectionActivity extends BaseQuestionActivity
        implements CollectionContract.View {

    CollectionContract.Presenter spePresenter;

    int sectionId;
    String pagerName;


    public static void start(Context source,
                             int sectionId,
                             String name) {
        source.startActivity(new Intent(source, QuestionCollectionActivity.class)
                .putExtra("sectionId", sectionId)
                .putExtra("epName", name)
        );
    }


    @Override
    public Class getClassT() {
        return CollectionInfoMateriFragment.class;
    }

    @Override
    public Class getClassK() {
        return CollectionInfoSimpleFragment.class;
    }

    @Override
    protected void initView() {
        super.initView();
        pagerName = getIntent().getStringExtra("epName");
        name.setText(pagerName);
    }


    @Override
    public void initData() {
        super.initData();
        sectionId = getIntent().getIntExtra("sectionId", -1);
        spePresenter = new CollectionContract.Presenter();
        spePresenter.attachView(this);
        spePresenter.getQuestions(sectionId );
    }

    @Override
    public void lastOne() {
//        finish();
    }

    @Override
    public void back() {
        finish();
    }


    @Override
    public void setTypeList(List<ChapterType> chapterSectionTypes) {

    }

    @Override
    public void setQuestions(List<QuestionParent> questionList) {
        setThisActData(questionList);
    }


}
